package avicit.bdp.dcs.semistructure.dto;

import io.swagger.annotations.ApiModelProperty;

import java.util.List;

public class CatalogAndFileDto {

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "路径")
    private String path;

    @ApiModelProperty(value = "父目录路径")
    private String parentCatalogPath;

    @ApiModelProperty(value = "目录标识")
    private boolean isDirectory;

    @ApiModelProperty(value = "是否最后一级")
    private boolean lastestLevel;

    @ApiModelProperty(value = "模板信息")
    private List<TemplateDTO> templateDTOList;

    @ApiModelProperty(value = "children")
    private List<CatalogAndFileDto> children;

    public CatalogAndFileDto(Builder builder) {
        this.name = builder.name;
        this.path = builder.path;
        this.parentCatalogPath = builder.parentCatalogPath;
        this.isDirectory = builder.isDirectory;
        this.lastestLevel = builder.lastestLevel;
        this.templateDTOList = builder.templateDTOList;
        this.children = builder.children;
    }

    public CatalogAndFileDto(){

    }

    public static Builder builder(){
        return new Builder();
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isLastestLevel() {
        return lastestLevel;
    }

    public void setLastestLevel(boolean lastestLevel) {
        this.lastestLevel = lastestLevel;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public boolean isDirectory() {
        return isDirectory;
    }

    public void setDirectory(boolean directory) {
        isDirectory = directory;
    }

    public List<CatalogAndFileDto> getChildren() {
        return children;
    }

    public void setChildren(List<CatalogAndFileDto> children) {
        this.children = children;
    }

    public List<TemplateDTO> getTemplateDTOList() {
        return templateDTOList;
    }

    public void setTemplateDTOList(List<TemplateDTO> templateDTOList) {
        this.templateDTOList = templateDTOList;
    }

    public String getParentCatalogPath() {
        return parentCatalogPath;
    }

    public void setParentCatalogPath(String parentCatalogPath) {
        this.parentCatalogPath = parentCatalogPath;
    }

    public static class Builder{
        private String name;
        private String path;
        private String parentCatalogPath;
        private boolean isDirectory;
        private boolean lastestLevel;
        private List<TemplateDTO> templateDTOList;
        private List<CatalogAndFileDto> children;

        public Builder name(String name) {
            this.name = name;
            return this;
        }
        public Builder path(String path) {
            this.path = path;
            return this;
        }
        public Builder parentCatalogPath(String parentCatalogPath) {
            this.parentCatalogPath = parentCatalogPath;
            return this;
        }
        public Builder isDirectory(Boolean isDirectory) {
            this.isDirectory = isDirectory;
            return this;
        }
        public Builder lastestLevel(Boolean lastestLevel) {
            this.lastestLevel = lastestLevel;
            return this;
        }
        public Builder templateDTOList(List<TemplateDTO> templateDTOList) {
            this.templateDTOList = templateDTOList;
            return this;
        }
        public Builder children(List<CatalogAndFileDto> children) {
            this.children = children;
            return this;
        }
        public CatalogAndFileDto build() {
            return new CatalogAndFileDto(this);
        }
    }
}
